package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.MrAppendPage;
import com.dhcc.DRGsHosp.facade.dto.MrAppendPageDTO;

public class MrAppendPageAssembler {

	public static MrAppendPageDTO  toDTO(MrAppendPage  mrAppendPage){
		if (mrAppendPage == null) {
			return null;
		}
		MrAppendPageDTO mrAppendPageDto  = new MrAppendPageDTO();
		mrAppendPageDto.setPmainIndex(mrAppendPage.getPmainIndex());
		mrAppendPageDto.setP90010000(mrAppendPage.getP90010000());
		mrAppendPageDto.setP90010001(mrAppendPage.getP90010001());
		mrAppendPageDto.setP90020000(mrAppendPage.getP90020000());
		mrAppendPageDto.setP90020001(mrAppendPage.getP90020001());
		mrAppendPageDto.setP90031000(mrAppendPage.getP90031000());
		mrAppendPageDto.setP90031001(mrAppendPage.getP90031001());
		mrAppendPageDto.setP90032000(mrAppendPage.getP90032000());
		mrAppendPageDto.setP90041000(mrAppendPage.getP90041000());
		mrAppendPageDto.setP90042000(mrAppendPage.getP90042000());
		mrAppendPageDto.setP90051000(mrAppendPage.getP90051000());
		mrAppendPageDto.setP90051001(mrAppendPage.getP90051001());
		mrAppendPageDto.setP90052000(mrAppendPage.getP90052000());
		mrAppendPageDto.setP90061000(mrAppendPage.getP90061000());
		mrAppendPageDto.setP90061001(mrAppendPage.getP90061001());
		mrAppendPageDto.setP90062000(mrAppendPage.getP90062000());
		mrAppendPageDto.setP90070000(mrAppendPage.getP90070000());
		mrAppendPageDto.setP90080000(mrAppendPage.getP90080000());
		mrAppendPageDto.setP90080001(mrAppendPage.getP90080001());
		mrAppendPageDto.setP90090000(mrAppendPage.getP90090000());
		mrAppendPageDto.setP90090001(mrAppendPage.getP90090001());
		mrAppendPageDto.setP90100000(mrAppendPage.getP90100000());
		mrAppendPageDto.setP90100001(mrAppendPage.getP90100001());
		mrAppendPageDto.setP90110000(mrAppendPage.getP90110000());
		mrAppendPageDto.setP90110001(mrAppendPage.getP90110001());
		mrAppendPageDto.setP90120000(mrAppendPage.getP90120000());
		mrAppendPageDto.setP90120001(mrAppendPage.getP90120001());
		mrAppendPageDto.setP90120201(mrAppendPage.getP90120201());
		mrAppendPageDto.setP90130000(mrAppendPage.getP90130000());
		mrAppendPageDto.setP90130001(mrAppendPage.getP90130001());
		mrAppendPageDto.setP90140000(mrAppendPage.getP90140000());
		mrAppendPageDto.setP90140001(mrAppendPage.getP90140001());
		mrAppendPageDto.setP90150000(mrAppendPage.getP90150000());
		mrAppendPageDto.setP90150001(mrAppendPage.getP90150001());
		mrAppendPageDto.setP90160000(mrAppendPage.getP90160000());
		
		//中铁17局特有病案首页字段
		mrAppendPageDto.setP90200001(mrAppendPage.getP90200001());
		mrAppendPageDto.setP90210001(mrAppendPage.getP90210001());
		mrAppendPageDto.setP90215001(mrAppendPage.getP90215001());
		mrAppendPageDto.setP90220001(mrAppendPage.getP90220001());
		mrAppendPageDto.setP90230001(mrAppendPage.getP90230001());
		mrAppendPageDto.setP90240001(mrAppendPage.getP90240001());
		mrAppendPageDto.setP90250001(mrAppendPage.getP90250001());
		mrAppendPageDto.setP90260001(mrAppendPage.getP90260001());
		mrAppendPageDto.setP90270001(mrAppendPage.getP90270001());
		mrAppendPageDto.setP90280001(mrAppendPage.getP90280001());
		mrAppendPageDto.setP90290001(mrAppendPage.getP90290001());
		mrAppendPageDto.setP00475000(mrAppendPage.getP00475000());
		mrAppendPageDto.setP00475001(mrAppendPage.getP00475001());
		mrAppendPageDto.setP00335000(mrAppendPage.getP00335000());
		mrAppendPageDto.setP00336000(mrAppendPage.getP00336000());
		
 	    return mrAppendPageDto;
	 }
	
	public static List<MrAppendPageDTO>  toDTOs(Collection<MrAppendPage>  mrAppendPages){
		if (mrAppendPages == null) {
			return null;
		}
		List<MrAppendPageDTO> appendPageList = new ArrayList<MrAppendPageDTO>();
		for (MrAppendPage appendPage : mrAppendPages) {
			appendPageList.add(toDTO(appendPage));
		}
		return appendPageList;
	}
	
	 public static MrAppendPage  toEntity(MrAppendPageDTO  mrAppendPageDTO){
	 	if (mrAppendPageDTO == null) {
			return null;
		}
	 	MrAppendPage mrAppendPage  = new MrAppendPage();
		mrAppendPage.setPmainIndex(mrAppendPageDTO.getPmainIndex());
		mrAppendPage.setP90010000(mrAppendPageDTO.getP90010000());
		mrAppendPage.setP90010001(mrAppendPageDTO.getP90010001());
		mrAppendPage.setP90020000(mrAppendPageDTO.getP90020000());
		mrAppendPage.setP90020001(mrAppendPageDTO.getP90020001());
		mrAppendPage.setP90031000(mrAppendPageDTO.getP90031000());
		mrAppendPage.setP90031001(mrAppendPageDTO.getP90031001());
		mrAppendPage.setP90032000(mrAppendPageDTO.getP90032000());
		mrAppendPage.setP90041000(mrAppendPageDTO.getP90041000());
		mrAppendPage.setP90042000(mrAppendPageDTO.getP90042000());
		mrAppendPage.setP90051000(mrAppendPageDTO.getP90051000());
		mrAppendPage.setP90051001(mrAppendPageDTO.getP90051001());
		mrAppendPage.setP90052000(mrAppendPageDTO.getP90052000());
		mrAppendPage.setP90061000(mrAppendPageDTO.getP90061000());
		mrAppendPage.setP90061001(mrAppendPageDTO.getP90061001());
		mrAppendPage.setP90062000(mrAppendPageDTO.getP90062000());
		mrAppendPage.setP90070000(mrAppendPageDTO.getP90070000());
		mrAppendPage.setP90080000(mrAppendPageDTO.getP90080000());
		mrAppendPage.setP90080001(mrAppendPageDTO.getP90080001());
		mrAppendPage.setP90090000(mrAppendPageDTO.getP90090000());
		mrAppendPage.setP90090001(mrAppendPageDTO.getP90090001());
		mrAppendPage.setP90100000(mrAppendPageDTO.getP90100000());
		mrAppendPage.setP90100001(mrAppendPageDTO.getP90100001());
		mrAppendPage.setP90110000(mrAppendPageDTO.getP90110000());
		mrAppendPage.setP90110001(mrAppendPageDTO.getP90110001());
		mrAppendPage.setP90120000(mrAppendPageDTO.getP90120000());
		mrAppendPage.setP90120001(mrAppendPageDTO.getP90120001());
		mrAppendPage.setP90120201(mrAppendPageDTO.getP90120201());
		mrAppendPage.setP90130000(mrAppendPageDTO.getP90130000());
		mrAppendPage.setP90130001(mrAppendPageDTO.getP90130001());
		mrAppendPage.setP90140000(mrAppendPageDTO.getP90140000());
		mrAppendPage.setP90140001(mrAppendPageDTO.getP90140001());
		mrAppendPage.setP90150000(mrAppendPageDTO.getP90150000());
		mrAppendPage.setP90150001(mrAppendPageDTO.getP90150001());
		mrAppendPage.setP90160000(mrAppendPageDTO.getP90160000());
		
		//中铁17局特有病案首页字段
		mrAppendPage.setP90200001(mrAppendPageDTO.getP90200001());
		mrAppendPage.setP90210001(mrAppendPageDTO.getP90210001());
		mrAppendPage.setP90215001(mrAppendPageDTO.getP90215001());
		mrAppendPage.setP90220001(mrAppendPageDTO.getP90220001());
		mrAppendPage.setP90230001(mrAppendPageDTO.getP90230001());
		mrAppendPage.setP90240001(mrAppendPageDTO.getP90240001());
		mrAppendPage.setP90250001(mrAppendPageDTO.getP90250001());
		mrAppendPage.setP90260001(mrAppendPageDTO.getP90260001());
		mrAppendPage.setP90270001(mrAppendPageDTO.getP90270001());
		mrAppendPage.setP90280001(mrAppendPageDTO.getP90280001());
		mrAppendPage.setP90290001(mrAppendPageDTO.getP90290001());
		mrAppendPage.setP00475000(mrAppendPageDTO.getP00475000());
		mrAppendPage.setP00475001(mrAppendPageDTO.getP00475001());
		mrAppendPage.setP00335000(mrAppendPageDTO.getP00335000());
		mrAppendPage.setP00336000(mrAppendPageDTO.getP00336000());
 	  	return mrAppendPage;
	 }
	
	public static List<MrAppendPage> toEntities(Collection<MrAppendPageDTO> mrAppendPageDTOs) {
		if (mrAppendPageDTOs == null) {
			return null;
		}
		
		List<MrAppendPage> mrAppendPageList = new ArrayList<MrAppendPage>();
		for (MrAppendPageDTO mrAppendPage : mrAppendPageDTOs) {
			mrAppendPageList.add(toEntity(mrAppendPage));
		}
		return mrAppendPageList;
	}
}
